package com.fei.fpmall.common.utils;

import javax.servlet.http.HttpServletRequest;

import com.fei.fpmall.core.utils.Const;
import com.fei.fpmall.entity.basemanage.User;



/**
 * Created by chenjiayu on 2017-09-27
 */
public class UserUtil {

	
	
    /**
     * 获取登录信息
     * @param request
     * @return
     */
    public static User getLoginUser(HttpServletRequest request){
    	User loginMember = (User) request.getSession().getAttribute(Const.SESSION_MEMBER);
        return loginMember;
    }

    
    /**
     * 设置登录信息
     * @param request
     * @param member
     */
    public static void setLoginUser(HttpServletRequest request,User member){
        request.getSession().setAttribute(Const.SESSION_MEMBER,member);
    }
    
}
